<html>
<title>Release Process</title>
<body>
<h2>Release Process</h2>

<h3>First time set up</h3>
<ul>
  <li>Make sure you have at least a Committer role</li>
  <li>Make sure you have permission to post to the <a
    href="http://google-api-java-client.blogspot.com/">Announcement Blog</a>.</li>
  <li>Check out the <code>google-api-java-client</code> project using <a
    href="http://google-api-java-client.googlecode.com/hg/instructions.html?r=1.2.3-alpha">these
  instructions</a>.</li>
  <li>Check out the <code>javadoc</code> project using <a
    href="http://javadoc.google-api-java-client.googlecode.com/hg/instructions.html">these
  instructions</a> into the same parent directory as the <code>google-api-java-client</code>
  project.</li>
  <li>Download <a href="http://sourceforge.net/projects/javadiff/">JDiff</a>.</li>
  <li>Set up for pushing to central Maven repository
  <ul>
    <li>Sign up for a Sonatype JIRA account at <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>. Click
    <i>Sign Up</i> in the Login box, fill out the simple form, and click <i>Sign
    Up</i>.</li>
    <li>Install a GPG client from <a href="http://www.gnupg.org/">http://www.gnupg.org/</a>,
    and then create a GPG key using <a
      href="http://www.sonatype.com/people/2010/01/how-to-generate-pgp-signatures-with-maven/">these
    instructions</a>, making sure to specify a passphrase to be used every time you
    release.</li>
    <li>Add these lines to your <code>~/.hgrc</code>: <pre><code>google-api-java-client.prefix = https://google-api-java-client.googlecode.com/hg/
google-api-java-client.username = <i>[username from <a
      href="https://code.google.com/hosting/settings">https://code.google.com/hosting/settings</a>]</i>
google-api-java-client.password = <i>[password from <a
      href="https://code.google.com/hosting/settings">https://code.google.com/hosting/settings</a>]</i></code></pre></li>
    <li>Add these lines to your <code>~/.m2/settings.xml</code> (create
    this file if it does not already exist): <pre><code>&lt;settings&gt;
  &lt;servers&gt;
    &lt;server&gt;
      &lt;id&gt;google-snapshots&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
    &lt;server&gt;
      &lt;id&gt;google-releases&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
    &lt;server&gt;
      &lt;id&gt;sonatype-nexus-snapshots&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
    &lt;server&gt;
      &lt;id&gt;sonatype-nexus-staging&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
  &lt;/servers&gt;
&lt;/settings&gt;</code></pre></li>
  </ul>
  </li>
</ul>

<h3>Release version 1.2.3-alpha (bug fix release)</h3>
<ul>
  <li>Prepare the project
  <ul>
    <li>Re-run <code>GeneratePom</code> in Eclipse
    <ul>
      <li>Select project <code>google-api-client</code></li>
      <li>Project &gt; Clean...</li>
      <li>OK</li>
      <li>Run <code>GeneratePom</code></li>
      <li>If any modules/*/pom.xml file is updated, make sure to also
      update the corresponding package.html file</li>
    </ul>
    </li>
    <li><code>hg commit</code> if you have any uncommitted changes</li>
  </ul>
  </li>
  <li>Push to central Maven repository (based on instructions from <a
    href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide">Sonatype
  OSS Maven Repository Usage Guide</a>):
  <ul>
    <li>Prepare:<pre><code>cd google-api-java-client
mvn clean deploy
mvn release:clean</code></pre></li>
    <li><code>mvn release:prepare -DautoVersionSubmodules=true</code>
    <ul>
      <li>Accept default for 'What is the release version for "Google API
      Client - Parent"?'</li>
      <li>Type <code>1.2.3-alpha</code> for 'What is SCM release tag or
      label for "Google API Client - Parent"?'</li>
      <li>Accept default for 'What is the new development version for
      "Google API Client - Parent"?'</li>
    </ul>
    </li>
    <li><code>mvn release:perform -Darguments=-Dgpg.passphrase=<i>[YOUR
    GPG PASSPHRASE]</i></code></li>
    <li>Release on oss.sonatype.org
    <ul>
      <li>Log in to <a href="https://oss.sonatype.org">https://oss.sonatype.org</a></li>
      <li>Click on "Staging Repositories"</li>
      <li>check box next to uploaded release</li>
      <li>click Close button; type <code>1.2.3-alpha</code> and click Close</li>
      <li>check box next to uploaded release</li>
      <li>click Release button; type <code>1.2.3-alpha</code> and click
      Release</li>
    </ul>
    </li>
    <li>Central Maven repository is synced hourly. Wait for the new version
    at: <a
      href="http://repo2.maven.org/maven2/com/google/api/client/google-api-client/">repo2.maven.org</a></li>
  </ul>
  </li>
  <li>Prepare the released library zip file and javadoc
  <ul>
    <li>change these constants from assemble/jdiff.xml for your
    environment: JDIFF_HOME, MAVEN_REPOSITORY_HOME, and PROJECT_ROOT_DIR</li>
    <li><pre><code>hg update -r 1.2.3-alpha
mvn clean install
cd google-api-client
mvn source:jar javadoc:jar assembly:assembly
cp -R target/apidocs ../../javadoc/1.2.3-alpha
cd /tmp
rm -rf google-api-java-client
hg clone -r 1.1.1-alpha https://google-api-java-client.googlecode.com/hg/ google-api-java-client
cd -
ant -f assemble/jdiff.xml
cd ../../javadoc
hg add
hg commit -m "1.2.3-alpha"
hg push
cd ../google-api-java-client
</code></pre></li>
  </ul>
  </li>
  <li>Update to new version on <a
    href="http://code.google.com/p/google-api-java-client">http://code.google.com/p/google-api-java-client</a>
  <ul>
    <li>Upload to <a
      href="http://code.google.com/p/google-api-java-client/downloads/entry">http://code.google.com/p/google-api-java-client/downloads/entry</a>
    <ul>
      <li>Summary: Google API Client Library for Java, version 1.2.3-alpha</li>
      <li>File: <code>google-api-java-client/target/google-api-client-1.2.3-alpha-java.zip</code></li>
      <li>Labels: <code>Type-Archive</code>, <code>OpSys-All</code>, and <code>Featured</code></li>
      <li>click Submit file</li>
    </ul>
    </li>
    <li>Deprecate the library from any previous versions by removing any <code>Featured</code>
    label and adding the <code>Deprecated</code> label.</li>
    <li>Update the following pages changing any reference from the previous
    version to the new version <code>1.2.3-alpha</code>:
    <ul>
      <li><a href="http://code.google.com/p/google-api-java-client/admin">admin</a></li>
      <li><a
        href="http://code.google.com/p/google-api-java-client/w/edit/Setup">wiki/Setup</a></li>
      <li><a
        href="http://code.google.com/p/google-api-java-client/w/edit/SampleProgram">wiki/SampleProgram</a></li>
    </ul>
    </li>
  </ul>
  </li>
  <li><a
    href="http://www.blogger.com/post-create.g?blogID=4531100327392916335">New
  Post</a> on the <a href="http://google-api-java-client.blogspot.com/">announcement
  blog</a> about the new version, including links to:
  <ul>
    <li>Title: Version 1.2.3-alpha released</li>
    <li>Subject: <a
      href="http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone=Version1.2.3%20type=Enhancement&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary">Features:</a>
    (bullet list) <a
      href="http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone=Version1.2.3%20type=Defect&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary">Bugs
    Fixed</a> (bullet list)</li>
  </ul>
  </li>
  <li>Start development of next minor version
  <ul>
    <li><code>hg update</code></li>
    <li>For the following files, replace <code>1.2.3-alpha</code> with <code>1.2.4-alpha</code>:
    <ul>
      <li><code>google-api-client/assemble/jdiff.xml</code></li>
      <li><code>google-api-client/assemble/release.html</code> (though
      beforehand replace 1.2.4-alpha with next minor version)</li>
      <li><code>google-api-client/generator/com/google/api/client/generator/model/PackageModel.java</code></li>
      <li><code>google-api-client/src/com/google/api/client/http/HttpRequest.java</code></li>
    </ul>
    </li>
    <li>Re-run <code>GeneratePom</code> in Eclipse
    <ul>
      <li>Select project <code>google-api-client</code></li>
      <li>Project &gt; Clean...</li>
      <li>OK</li>
      <li>Run <code>GeneratePom</code></li>
      <li>If any modules/*/pom.xml file is updated, make sure to also
      update the corresponding package.html file</li>
    </ul>
    </li>
    <li><code>hg commit -m "start 1.2.4-alpha"</code></li>
  </ul>
  </li>
</ul>
</body>
</html>
